﻿<%@ Page 
  Language="C#" 
  AutoEventWireup="true" 
  ValidateRequest="false"
  CodeFile="demoCkeditor.aspx.cs" 
  Inherits="demoCkeditor_demoCkeditor" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="ckeditor/ckeditor.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    
    <asp:ScriptManager ID="SM" runat="server"></asp:ScriptManager>
    
    <div>
      <CKEditor:CKEditorControl ID="editor" runat="server" />
      <script type="text/javascript">

        function setupEditor() {
        
          var editor = '<%= editor.ClientID %>';

          CKEDITOR.replace(editor,
          {
            filebrowserBrowseUrl: 'ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl: 'ckfinder/ckfinder.html?type=Images',
            filebrowserFlashBrowseUrl: 'ckfinder/ckfinder.html?type=Flash',
            filebrowserUploadUrl: 'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl: 'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl: 'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
          });

          Sys.Application.remove_load(setupEditor);
        }

        Sys.Application.add_load(setupEditor);
        
      </script>
    </div>
    
    <div>
      <asp:Button 
        ID="BtnSave" 
        runat="server" 
        
        Text="Save" onclick="BtnSave_Click" />
    </div>
    
    <hr />
    
    <div class="cke_contents">
      <asp:Literal ID="outcome" runat="server"/>
    </div>
    </form>
</body>
</html>
